<script setup lang="ts">
import {data} from '@/stores/data'
import { ref } from 'vue'
import  router  from '@/router';
// const Props=defineProps(['username'])
const username = ref('')
const password=ref('')
function handleSubmit() {
  if(username.value!==''&&password.value){
    data.username = username.value
    data.password = password.value
    router.push('/login')
  }else{
    alert("请输入用户名和密码")
  }
}
</script>


<template>
<!-- 注册卡片 -->
    <div style="display: flex;flex-direction: column;box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);padding: 20px;border-radius: 10px;position: relative;;left: 45%;margin-top: 50px;">   
        <input type="text" v-model="username" style="margin-top: 30px;height: 50px;"placeholder='请输入用户名'>
        <input type="password" v-model="password"style="margin-top: 30px;height: 50px;" placeholder="请输入密码">
        <input @click="handleSubmit()" type="button"  style="margin-top: 30px;height: 50px;width: 300px;background-color: aqua;color: white;cursor: pointer;" value="注册">
        <RouterLink to="/login">已有账号？点此登录</RouterLink>
    </div>

</template>